﻿var url = new Url();
var $css = url.GetQueryString("css");
//设置分页信息
var page = new Page();
page.Url = "../Handler/BankInfoHandler.ashx";
page.Dom = $("#searchArea");
page.type = 6;
page.CallBack = function (data) {
    $("#dataList").empty();
    $.each(data, function (index, item) {
        item.Css = $css;
        $("#BankInfoListTemplete").tmpl(item).appendTo("#dataList");
    });
};
page.GetPageData();
//添加
$(".add").bind("click", function () {
    location.href = "BankInfoEdit.aspx?css=" + $css;
});
//删除
function del(id) {
    if (confirm("确定要删除该条记录吗？")) {
        $.ajax({
            url: "../Handler/BankInfoHandler.ashx",
            data: { Id: id, type: 3, _: Math.random() },
            type: "post",
            dataType: 'json',
            cache: false,
            success: function (result) {
                if (result.Status) {
                    $("#btnSearch").click();
                }
                else {
                    alert(result.Message);
                }
            }
        });
    }
}